home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / LOGYAG.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-28  |  5.3 KB  |  211 lines

  1. 10  'LOGYAG   Log-Periodic Yagi Array - 03 MAR 95 rev. 18 DEC 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  U1$="###.###"
  6. 60  U2$="##.###"
  7. 70  UL$=STRING$(80,205)
  8. 80  PI=3.14159
  9. 90  '
  10. 100  '.....start
  11. 110  CLS
  12. 120  COLOR 15,2
  13. 130  PRINT " LOG-YAG Log-Periodic Yagi Antenna";
  14. 140  PRINT TAB(57);"by George Murphy VE3ERP ";
  15. 150  COLOR 1,0:PRINT STRING$(80,223);
  16. 160  COLOR 7,0
  17. 170  GOSUB 1920      'standard antenna preface
  18. 180  PRINT UL$;
  19. 190  GOSUB 1680      'notes
  20. 200  Z$=INKEY$:IF Z$=""THEN 200
  21. 210  IF Z$="0"THEN CLS:RUN EX$
  22. 220  IF Z$="1"THEN 250
  23. 230  GOTO 200
  24. 240  '
  25. 250  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  26. 260  PRINT " Press number in < > to choose standard units of measure:"
  27. 270  PRINT UL$;
  28. 280  PRINT "   < 1 >  Metric"
  29. 290  PRINT "   < 2 >  U.S.A./Imperial"
  30. 300  Z$=INKEY$
  31. 310  IF Z$="1"THEN UM=0.3048:UM$="m":GOTO 340
  32. 320  IF Z$="2"THEN UM=1:UM$="'":GOTO 340
  33. 330  GOTO 300
  34. 340  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  35. 350  GOTO 410
  36. 360  '
  37. 370  '.....erase previous line
  38. 380  LOCATE CSRLIN-1:PRINT:LOCATE CSRLIN-1
  39. 390  RETURN
  40. 400  '
  41. 410  '.....start
  42. 420  LOCATE 3
  43. 430  INPUT " ENTER: Low edge of band (MHz)................";FL
  44. 440  GOSUB 370
  45. 450  PRINT "        Low edge of band......................";USING U1$;FL;
  46. 460  PRINT " MHz"
  47. 470  INPUT " ENTER: High edge of band (MHz)...............";FH
  48. 480  GOSUB 370
  49. 490  PRINT "        High edge of band.....................";USING U1$;FH;
  50. 500  PRINT " MHz"
  51. 510  B=FH/FL
  52. 520  PRINT "        Operating bandwidth...................";USING U1$;B
  53. 530  BS=1.15*B
  54. 540  PRINT "        Structure bandwidth (log cell array)..";USING U1$;BS
  55. 550  INPUT " ENTER: Number of driven elements.............";N
  56. 560  DIM DE(N,3)
  57. 570  GOSUB 370
  58. 580  PRINT "        Number of driven elements.............";USING "###";N;
  59. 590  PRINT "     "
  60. 600  K=1/(BS^(1/(N-1)))
  61. 610  PRINT "        Design constant.....................==";USING U1$;K
  62. 620  '
  63. 630  Z1=0.2/(1-K)  'cotangent of apex half-angle
  64. 640  Z2=1/Z1      'tangent of apex half-angle
  65. 650  Z3=ATN(Z2)   'apex half-angle in radians
  66. 660  '
  67. 670  DEG=Z3*180/PI
  68. 680  PRINT "        Apex half-angle.......................";USING U1$;DEG;
  69. 690  PRINT "<UNK! {00F8}>"
  70. 700  WMAX=984/FL
  71. 710  PRINT "        Free-space wavelength.................";USING U1$;WMAX*UM;
  72. 720  PRINT UM$
  73. 730  L=(0.25*(1-1/BS)*Z1)*WMAX
  74. 740  PRINT "        Log cell boom length..................";USING U1$;L*UM;
  75. 750  PRINT UM$;" ( El. 1 to El.";N;")"
  76. 760  '
  77. 770  '.....element lengths
  78. 780  DE(1,1)=492/FL
  79. 790   FOR Z=2 TO N
  80. 800    DE(Z,1)=K*DE(Z-1,1)
  81. 810   NEXT Z
  82. 820  '
  83. 830  '.....element spacing
  84. 840  DE(1,2)=0.5*(DE(1,1)-DE(2,1))*Z1:DE(1,3)=DE(1,2)
  85. 850   FOR Z=2 TO N-1
  86. 860    DE(Z,2)=K*DE(Z-1,2)
  87. 870    DE(Z,3)=DE(Z-1,3)+DE(Z,2)    'total distance from element #1
  88. 880   NEXT Z
  89. 890  '
  90. 900  '.....reflector
  91. 910  LREF=509.6/FL
  92. 920  DREF=84/FL
  93. 930  '
  94. 940  '.....director
  95. 950  LDIR=450.8/FL
  96. 960  DDIR=148/FL
  97. 970  '
  98. 980  BOOM=L+DREF+DDIR     'boom length
  99. 990  '
  100. 1000  '.....screen print
  101. 1010  PRINT "        Reflector length......................";USING U1$;LREF*UM;
  102. 1020  PRINT UM$
  103. 1030  PRINT UL$;
  104. 1040  LN=CSRLIN-1
  105. 1050  FOR Z=1 TO N
  106. 1060  Z$=RIGHT$(STR$(Z),LEN(STR$(Z))-1)
  107. 1070  IF LEN(Z$)<2 THEN Z$=" "+Z$
  108. 1080  LN=LN+1
  109. 1090   PRINT "        Element #";Z$;" length....................";
  110. 1100  PRINT USING U1$;DE(Z,1)*UM;
  111. 1110   PRINT UM$;" @";
  112. 1120  IF Z=1 THEN PRINT USING U1$;DREF*UM;:PRINT UM$;" from Reflector":GOTO 1180
  113. 1130   IF DE(Z-1,2)=0 THEN PRINT "":GOTO 1180
  114. 1140   PRINT USING U1$;DE(Z-1,3)*UM;
  115. 1150  PRINT UM$;" from # 1";
  116. 1160  IF LN<22 THEN PRINT "":GOTO 1180
  117. 1170  GOSUB 1980:CLS:LN=0
  118. 1180  NEXT Z
  119. 1190  '
  120. 1200   PRINT "        Director length.......................";USING U1$;LDIR*UM;
  121. 1210   PRINT UM$;" @";
  122. 1220   PRINT USING U1$;DDIR*UM;
  123. 1230  PRINT "' from #";Z-1
  124. 1240  PRINT "        Reflector-to-Director distance........";USING U1$;BOOM*UM;
  125. 1250  PRINT UM$;" (total boom length)"
  126. 1260  GOSUB 1980
  127. 1270  CLS
  128. 1280  '
  129. 1290  '.....diagram
  130. 1300  U=5       'length of 1/2 element
  131. 1310  PRINT " DIRECTOR";TAB(40-U-2);STRING$(U+2,196);" ";STRING$(U+2,196)
  132. 1320  LOCATE CSRLIN-1,36:PRINT"DEFSNG"USING U2$;LDIR;:PRINT UM$;"DEFDBL"
  133. 1330  PRINT TAB(40);"CALL"
  134. 1340  PRINT TAB(40);"CALL   ";USING U2$;DDIR;:PRINT UM$
  135. 1350  PRINT TAB(40);"CALL"
  136. 1360  LN=4
  137. 1370  '
  138. 1380     FOR Z=N TO 1 STEP-1
  139. 1390  LN=LN+1
  140. 1400  U=U+1:IF U>25 THEN U=25
  141. 1410  PRINT " Element #";Z;TAB(40-U);STRING$(U,"SOUND");"CALL";STRING$(U,196)
  142. 1420  LOCATE CSRLIN-1,36:PRINT"DEFSNG"USING U2$;DE(Z,1)*UM;:PRINT UM$;"DEFDBL"
  143. 1430  LN=LN+1:PRINT TAB(40);"CALL   ";
  144. 1440  X=DE(Z-1,2)*UM:IF X THEN PRINT USING U2$;DE(Z-1,2)*UM;:PRINT UM$;
  145. 1450  IF LN<22 THEN PRINT "":GOTO 1470
  146. 1460  GOSUB 1980:CLS:LN=0
  147. 1470     NEXT Z
  148. 1480  IF LN=0 THEN 1500
  149. 1490  LOCATE CSRLIN-1
  150. 1500  PRINT TAB(40);"CALL"
  151. 1510  PRINT TAB(40);"CALL   ";USING U2$;DREF*UM;:PRINT UM$
  152. 1520  U=U+2
  153. 1530  PRINT " REFLECTOR";TAB(40-U);STRING$(U,196);" ";STRING$(U,196);
  154. 1540  LOCATE CSRLIN,36:PRINT"DEFSNG"USING U2$;LREF;:PRINT UM$;"DEFDBL";
  155. 1550  COLOR 15,1
  156. 1560  LOCATE 1,56:PRINT " Log-Periodic Yagi for   "
  157. 1570  LOCATE 2,56:PRINT "                         "
  158. 1580  U$="####.###"
  159. 1590  IF FL<10^3 THEN U$="###.###"
  160. 1600  IF FL<10^2 THEN U$="##.###"
  161. 1610  IF FL<10 THEN U$="#.###"
  162. 1620  LOCATE 2,56:PRINT " ";USING U$;FL;:PRINT " - ";USING U$;FH;:PRINT " MHz"
  163. 1630  COLOR 7,0
  164. 1640  GOSUB 1980
  165. 1650  ERASE DE:GOTO 100   'start
  166. 1660  END
  167. 1670  '
  168. 1680  '.....notes
  169. 1690  TB=7
  170. 1700  PRINT TAB(TB);
  171. 1710  PRINT "This program does all the calculations pertaining to the article"
  172. 1720  PRINT TAB(TB);
  173. 1730  PRINT "'The Log-Yag Array' as it appears in the ARRL ANTENNA ANTHOLOGY,"
  174. 1740  PRINT TAB(TB);
  175. 1750  PRINT "publication No.36, page 49."
  176. 1760  PRINT
  177. 1770  PRINT TAB(TB);
  178. 1780  PRINT "While not absolutely necessary, the diagrams in this article might"
  179. 1790  PRINT TAB(TB);
  180. 1800  PRINT "be useful when designing a LOG-YAG."
  181. 1810  PRINT
  182. 1820  PRINT TAB(TB);
  183. 1830  PRINT "For a complete dissertation on LPDA (Log-Periodic Dipole Array)"
  184. 1840  PRINT TAB(TB);
  185. 1850  PRINT "antennas see any recent edition of the ARRL ANTENNA BOOK."
  186. 1860  PRINT UL$;
  187. 1870  COLOR 0,7:LOCATE CSRLIN,22
  188. 1880  PRINT " Press 1 to continue or 0 to EXIT....."
  189. 1890  COLOR 7,0
  190. 1900  RETURN
  191. 1910  '
  192. 1920  '.....preface
  193. 1930  OPEN"I",1,"\data\docfiles\antenna.doc"
  194. 1940  IF EOF(1)THEN 1960
  195. 1950  INPUT#1,NOTE$:PRINT "   ";NOTE$:GOTO 1940
  196. 1960  CLOSE:RETURN
  197. 1970  '
  198. 1980  'HARDCOPY
  199. 1990  GOSUB 2100:LOCATE 25,2:COLOR 14,6
  200. 2000  PRINT " Press 1 to print screen, 2 to print screen & ";
  201. 2010  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  202. 2020  Z$=INKEY$:IF Z$="3"THEN GOSUB 2100:RETURN
  203. 2030  IF Z$="1"OR Z$="2"THEN GOSUB 2100:GOTO 2050
  204. 2040  GOTO 2020
  205. 2050  FOR QX=1 TO 24:FOR QY=1 TO 80
  206. 2060  LPRINT CHR$(SCREEN(QX,QY));
  207. 2070  NEXT QY:NEXT QX
  208. 2080  IF Z$="2"THEN LPRINT CHR$(12)
  209. 2090  GOTO 1990
  210. 2100  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  211.